﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class GetEnumOptionsHelper
    {

        public static List<object> GetEnumOptions(Type type)
        {
            List<object> list = new List<object>();
            foreach (var temp in Enum.GetValues(type))
            {
                var i = (int)temp;
                var name = temp.ToString();
                list.Add(new
                {
                    Name = name,
                    Value = i
                });
            }
            return list;
        }
    }
}
